set -eux
# prepare build env

cat /etc/yum.repos.d/openEuler.repo
cp -a  /etc/yum.repos.d/openEuler.repo  /etc/yum.repos.d/openEuler.repo.bak

sed -i 's#http://repo.openeuler.org/#https://repo.huaweicloud.com/openeuler/#g' /etc/yum.repos.d/openEuler.repo

cat > /etc/yum.repos.d/openEuler.repo  <<"EOF"
[openEuler]
name=openEuler
baseurl=file:///opt/openEuler
enabled=1
gpgcheck=1
gpgkey=file:///opt/openEuler/RPM-GPG-KEY-openEuler
EOF

yum clean metadata -y
yum makecache

# rsync rpm-build   
yum install -y  openssl-devel bc  \
    gcc gcc-c++ make  cmake ninja-build \
    flex bison m4 elfutils-libelf-devel  \
    git python3-devel binutils-devel 
